entry: Document buildable support
authorMatthias Clasen <mclasen@redhat.com>
Tue, 7 Apr 2020 03:29:47 +0000 (23:29 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 7 Apr 2020 03:33:22 +0000 (23:33 -0400)
gtk/gtkentry.c

index e823ab0d08f60c7d7270ee17e00e79505b16bc14..5e95bd6fc3bdbffc0871fdb29910e4e891005e10 100644 (file)
  *
  * For all the subnodes added to the text node in various situations,
  * see #GtkText.
+ *
+ * # GtkEntry as GtkBuildable
+ *
+ * The GtkEntry implementation of the GtkBuildable interface supports a
+ * custom <attributes> element, which supports any number of <attribute>
+ * elements. The <attribute> element has attributes named “name“, “value“,
+ * “start“ and “end“ and allows you to specify #PangoAttribute values for
+ * this label.
+ *
+ * An example of a UI definition fragment specifying Pango attributes:
+ * |[
+ * <object class="GtkEnry">
+ *   <attributes>
+ *     <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+ *     <attribute name="background" value="red" start="5" end="10"/>
+ *   </attributes>
+ * </object>
+ * ]|
+ *
+ * The start and end attributes specify the range of characters to which the
+ * Pango attribute applies. If start and end are not specified, the attribute is
+ * applied to the whole text. Note that specifying ranges does not make much
+ * sense with translatable attributes. Use markup embedded in the translatable
+ * content instead.
  */
 
 #define MAX_ICONS 2